﻿using RockBus.Hosting.Interfaces;
using RockBus.Initialization.Interfaces;
using RockBus.Logging.Interfaces;
using System.Reflection;

namespace RockBus.Hosting
{
    public class ServiceHostManagerInitialization : IInitialization
    {
        public ServiceHostManagerInitialization(ILogger logger, IServiceHostManager serviceHostManager)
        {
            this.Logger = logger;
            this.ServiceHostManager = serviceHostManager;
        }

        private ILogger Logger { get; set; }

        private IServiceHostManager ServiceHostManager { get; set; }

        public void Initialize()
        {
            this.Logger.LogInfo(MethodBase.GetCurrentMethod(), "Starting ServiceHostManager.");
            this.ServiceHostManager.Start();
        }
    }
}